/*
 * comandos.c
 *
 *  Created on: 11/12/2009
 *      Author: teledhil
 */

#include <stdio.h>
#include <string.h>
#include "comandos.h"
#include "consola.h"
#include "variablesGlobales.h"

int help() {

	output_debug("help");
	output_program("A typical user session goes like this:");
	output_program("");
	output_program("    /connect localhost:7101");
	output_program("    /auth alcortes");
	output_program("    /list");
	output_program("    /join #ro2");
	output_program("    hello");
	output_program("    /leave");
	output_program("    /disconnect");
	output_program("    /quit");
	output_program("");
	output_program("The full list of available commands are:");
	output_program("");
	output_program("    /help                    Show this text.");
	output_program("    /connect <host>:<port>   Connect to a server.");
	output_program("    /auth <nick>             Authenticate with the server,");
	output_program("                             sets nick, username & real name.");
	output_program("    /list                    Lists all current irc channels,");
	output_program("                             number of users, and topic.");
	output_program("    /join [<channel>]        Join a channel or tell which is");
	output_program("                             the current channel.");
	output_program("    /leave                   Leaves your current channel.");
	output_program("    /who                     List users in current channel.");
	output_program("    /msg <txt>               Send <txt> to the channel.");
	output_program("    /offer <file> <nick>     Launch a DCC server for a file");
	output_program("                             transfer.  The recipient must accept");
	output_program("                             your offer with a '/download'.");
	output_program("    /download <host:port> <file>");
	output_program("                             Starts a file transfer by DCC.");
	output_program("                             The  sender must first have offered");
	output_program("                             the file with an '/offer' command.");
	output_program("    /disconnect              Disconnect from server.");
	output_program("    /quit                    Close program.");
	output_program("    /nop [<text>]            (debugging) no operation,");
	output_program("                             just echoes <text> back.");
	output_program("    /sleep [<secs>]          (debugging) pause for <secs>");
	output_program("                             seconds.");
	output_program("");
	output_program("Lines from the user that don't begin with '/' are equivalent to");
	output_program("");
	output_program("    /msg line");
	output_program("");
	output_program("Lines beginning with \"*** \" are messages from the program.");
	output_program("Lines beginning with \"<user> \" are messages from <user>.");
	output_program("Lines beginning with \"DDD \" are debug messages from the program.");
	output_program("Lines beginning with \"> \" are your messages to other users.");
	output_program("The rest of the lines are echoes of the user commands.\n\n");

	return 0;
}

int connect(char *host, int port) {

	output_debug("connect: host=|%s|, port=|%d|",host, port);

	return 0;
}

int auth(char *nick) {

	output_debug("auth: nick=|%s|",nick);

	return 0;
}

int list() {

	output_debug("list");

	return 0;
}

int join(char *channel) {

	output_debug("join: channel=|%s|",channel);

	return 0;
}

int leave() {

	output_debug("leave");

	return 0;
}

int who() {

	output_debug("who");

	return 0;
}

int msg(char *text) {

	output_debug("msg: text=|%s|",text);




	output_me("%s",text);

	return 0;
}

int disconnect() {

	output_debug("disconnect");

	return 0;
}

int quit() {

	output_debug("quit");





	output_program("bye!");

	return 0;
}

int nop(char *text) {

	output_debug("nop: text=|%s|",text);

	return 0;
}

int sleep(int secs) {

	output_debug("sleep: secs=|%d|",secs);

	return 0;
}

int offer(char *filename, char *nick) {

	output_debug("offer: filename=|%s|, nick=|%s|",filename, nick);

	return 0;
}

int download(char *filename, char *host, int port) {

	output_debug("download: filename=|%s|, host=|%s|, port=|%d|",filename, host, port);

	return 0;
}

